<?php

namespace App\Tool;

use Illuminate\Support\Facades\Mail;

class SendEmail
{

    private string $to;
    private String $nickName = '尊敬的用户';


    public function sendEmailActive($view,$data)
    {
        Mail::send($view,$data,function ($message) {
            $message->to($this->getTo(), $this->getNickName())->subject('Welcome!');
        });
    }




    /**
     * @return string
     */
    public function getTo(): string
    {
        return $this->to;
    }

    /**
     * @param string $to
     */
    public function setTo(string $to): void
    {
        $this->to = $to;
    }

    /**
     * @return string
     */
    public function getNickName(): string
    {
        return $this->nickName;
    }

    /**
     * @param string $nickName
     */
    public function setNickName(string $nickName): void
    {
        $this->nickName = $nickName;
    }


}
